import java.io.IOException;
import java.io.File;
import javax.sound.sampled.*;

public class Track extends Thread {
    private static final int EXTERNAL_BUFFER_SIZE = 128000;
    private TargetDataLine m_line;
    private AudioFileFormat.Type m_targetType;
    private AudioInputStream m_audioInputStream;
    private File outputFile;
    private AudioFormat audioFormat;
    private Clip clip;

    public Track(DataLine line, File file) {
        clip = (Clip) line;
        try {
            clip.open(AudioSystem.getAudioInputStream(file));
        }
        catch (javax.sound.sampled.UnsupportedAudioFileException e) {}
        catch (java.io.IOException e) {}
        catch (javax.sound.sampled.LineUnavailableException e) {}
    }

    public void restart () {
        clip.setFramePosition(0);
        clip.start();
    }
    
    // will be needed when we decided to make threads stop
    public void stopPlaying() {
        clip.stop();
    }

    static public void print(String line) {
        System.out.println(line);
    }

    private static void out(String strMessage) {
        System.out.println(strMessage);
    }
}

/*** Track.java ***/
